import java.io.File;
import java.io.IOException;
import java.util.Random;
import java.util.Scanner;

public class Demo3 {
    public static void main(String[] args) throws IOException {
        Random random = new Random();

        int count = 0;
        while(count < 10000) {
            int i = random.nextInt(1,1000000);
            if(i%2 == 0) {
                String str = "D:\\text\\"+i;
                File file = new File(str);
                if(file.mkdir()) {
                    count++;
                }
            }else {
                String str = "D:\\text\\"+i+".txt";
                File file = new File(str);
                if(file.createNewFile()) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }
}
